﻿@{
    Layout = null;
}
@using Webdiyer.WebControls.Mvc;
@model System.Data.DataTable
@helper GerneratePager(string page, string allpage, string srcurl, string queryparam)
{
    <div class="pagin">
        <div class="message">
            共<i class="blue"> @ViewData["total"]</i>条记录，当前显示第&nbsp;<i class="blue"> @page</i>页共<i class="blue">@allpage</i>页
        </div>
        <ul class="paginList">
            @if (int.Parse(@allpage.ToString()) > 9)
            {
                if (int.Parse(@page.ToString()) == 1)
                {
                    <li class="paginItem"><a><span class="pagepre"></span></a></li>
                }
                else
                {
                    <li class="paginItem">
                        <a href="@srcurl@(int.Parse(@page.ToString()) - 1)@queryparam">
                            <span class="pagepre"></span>
                        </a>
                    </li>
                }
                if (int.Parse(@page.ToString()) < 6)
                {
                    for (int i = 1; i <= 6; i++)
                    {
                        if (i == int.Parse(@page.ToString()))
                        {
                            <li class="paginItem current"><a href="@srcurl@i@queryparam">@i</a></li>
                        }
                        else
                        {
                            <li class="paginItem"><a href="@srcurl@i@queryparam">@i</a></li>
                        }
                    }
                    <li class="paginItem more"><a href="javascript:;">...</a></li>
                    for (int i = int.Parse(@allpage.ToString()) - 2; i <= int.Parse(@allpage.ToString()); i++)
                    {
                        <li class="paginItem"><a href="@srcurl@i@queryparam">@i</a></li>
                    }
                }
                else if (int.Parse(@page.ToString()) > int.Parse(@allpage.ToString()) - 5)
                {
                    for (int i = 1; i <= 3; i++)
                    {
                        <li class="paginItem"><a href="@srcurl@i@queryparam">@i</a></li>
                    }
                    <li class="paginItem more"><a href="javascript:;">...</a></li>

                    for (int i = int.Parse(@allpage.ToString()) - 5; i <= int.Parse(@allpage.ToString()); i++)
                    {
                        if (i == int.Parse(@page.ToString()))
                        {
                            <li class="paginItem current"><a href="@srcurl@i@queryparam">@i</a></li>
                        }
                        else
                        {
                            <li class="paginItem"><a href="@srcurl@i@queryparam">@i</a></li>
                        }
                    }
                }
                else
                {
                    for (int i = 1; i <= 3; i++)
                    {
                        <li class="paginItem"><a href="@srcurl@i@queryparam">@i</a></li>
                    }
                    <li class="paginItem more"><a href="javascript:;">...</a></li>
                    <li class="paginItem"><a href="@srcurl@(int.Parse(@page.ToString()) - 1)@queryparam">@(int.Parse(@page.ToString()) - 1)</a></li>
                    <li class="paginItem current"><a href="@srcurl@(int.Parse(@page.ToString()))@queryparam">@int.Parse(@page.ToString())</a></li>
                    <li class="paginItem"><a href="@srcurl@(int.Parse(@page.ToString()) + 1)@queryparam">@(int.Parse(@page.ToString()) + 1)</a></li>
                    <li class="paginItem more"><a href="javascript:;">...</a></li>
                    for (int i = int.Parse(@allpage.ToString()) - 2; i <= int.Parse(@allpage.ToString()); i++)
                    {
                        <li class="paginItem"><a href="@srcurl@i@queryparam">@i</a></li>
                    }
                }

                if (int.Parse(@page.ToString()) == int.Parse(@allpage.ToString()))
                {
                    <li class="paginItem"><a><span class="pagenxt"></span></a></li>
                }
                else
                {
                    <li class="paginItem">
                        <a href="@srcurl@(int.Parse(@page.ToString()) + 1)@queryparam">
                            <span class="pagenxt"></span>
                        </a>
                    </li>
                }
            }
            else
            {

                if (int.Parse(@page.ToString()) == 1)
                {
                    <li class="paginItem"><a><span class="pagepre"></span></a></li>
                }
                else
                {
                    <li class="paginItem">
                        <a href="@srcurl@(int.Parse(@page.ToString()) - 1)@queryparam">
                            <span class="pagepre"></span>
                        </a>
                    </li>
                }

                for (int i = 1; i <= int.Parse(@allpage.ToString()); i++)
                {
                    if (i == int.Parse(@page.ToString()))
                    {
                        <li class="paginItem current"><a href="@srcurl@i@queryparam">@i</a></li>
                    }
                    else
                    {
                        <li class="paginItem"><a href="@srcurl@i@queryparam">@i</a></li>
                    }
                }
                if (int.Parse(@page.ToString()) == int.Parse(@allpage.ToString()))
                {
                    <li class="paginItem"><a><span class="pagenxt"></span></a></li>
                }
                else
                {
                    <li class="paginItem">
                        <a href="@srcurl@(int.Parse(@page.ToString()) + 1)@queryparam">
                            <span class="pagenxt"></span>
                        </a>
                    </li>
                }
                @*        <li class="paginItem"><a href="javascript:;"><span class="pagepre"></span></a></li>
                    <li class="paginItem"><a href="javascript:;">1</a></li>
                    <li class="paginItem current"><a href="javascript:;">2</a></li>
                    <li class="paginItem"><a href="javascript:;">3</a></li>
                    <li class="paginItem"><a href="javascript:;">4</a></li>
                    <li class="paginItem"><a href="javascript:;">5</a></li>
                    <li class="paginItem more"><a href="javascript:;">...</a></li>
                    <li class="paginItem"><a href="javascript:;">10</a></li>
                    <li class="paginItem"><a href="javascript:;"><span class="pagenxt"></span></a></li>*@
            }
        </ul>
    </div>




}
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>查询</title>

    <link href="/Content/DocTable.css" rel="stylesheet" type="text/css" />
    <link href="/Content/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
    <link href="/Content/style.css")" rel="stylesheet" type="text/css" />
    <link href="/Content/select.css" rel="stylesheet" type="text/css" />
    <link href="/Content/jquery-ui.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/Scripts/jquery.min.js")"></script>
    <script src="/Scripts/jquery-ui.custom.min.js" type="text/javascript"></script>
    <script src="/Scripts/select-ui.min.js" type="text/javascript"></script>
    <script src="/Scripts/checkinput.js" type="text/javascript"></script>
  
    <script src="/Scripts/jquery.autocomplete.js" type="text/javascript"></script>
    <script src="/Scripts/My97DatePicker/WdatePicker.js")" type="text/javascript"></script>
    <style type="text/css">
        .DocTableThin th {
            text-align: center;
        }

        .DocTableThin td {
            text-align: right;
            font-size: 14px;
            padding-right: 10px;
        }

        .searchtable tbody td {
            padding-top: 7px;
            padding-right: 3px;
            padding-right: 3px;
            text-align: center;
        }
    </style>
    <script type="text/javascript">
        $(document).ready(function () {
            $(".Wdate").click(function () {
                WdatePicker();
            });
        });

        function search() {
            //            var FAuditDate = $("#txtFAuditDate").val();
            //            var FEntName = $("#txtFEntName").val();
            //            var FIDNo = $("#txtFIDNo").val();
            //            var FEmpName = $("#txtFEmpName").val();
            //            var queryparamStr = " &FAuditDate=" + FAuditDate + " &FEntName=" + FEntName + " &FIDNo=" + FIDNo + " &FEmpName=" + FEmpName;
            //            window.location.href = rootPath + '@ViewData["srcurl"].ToString()' + "1" + queryparamStr + "&s=" + Math.random();

            $("#id").val("1");
            form1.submit();
        }
        function navPage(pg) {

            $("#id").val(pg);

            form1.submit();
        }
        function formreset() {
            window.location.href = '@ViewData["srcurl"].ToString()' + "1";

        }
    </script>
</head>
<body>
@using (Html.BeginForm("Index", "Query", FormMethod.Post, new { id = "form1", enctype = "multipart/form-data" }))
    {
    <div class="rightinfo">
        <div style="margin-left: auto; margin-right: auto; width: 900px; text-align: center;">
            <table class="searchtable" style="margin-right: auto; margin-left: auto">
                <tbody>
                    <tr>
                        <td width="60px">
                            <label>
                                所在商场:
                            </label>
                        </td>
                        <td>


                        <td colspan="1" style="text-align: center">
                            @Html.DropDownList("selszsc", ViewData["szsc"] as List<SelectListItem>,  new { @style = "width:100px;height:27px", @class = "select" })
                        </td>

                     
                        <td width="60px">
                            <label>
                                收银日期:
                            </label>
                        </td>
                        <td>
                            <input name="rqStart" id="txtFEntryDateStart" class="Wdate DocInputThin" value='@(!string.IsNullOrEmpty(ViewData["rqStart"].ToString()) ? DateTime.Parse(ViewData["rqStart"].ToString()).ToString("yyyy-MM-dd") : "")' type="text" style="width:100px;height:27px" />


                        </td>
                        <td>
                            <input name="rqEnd" id="txtFEntryDateStart" class="Wdate DocInputThin" value='@(!string.IsNullOrEmpty(ViewData["rqEnd"].ToString())  ? DateTime.Parse(ViewData["rqEnd"].ToString()).ToString("yyyy-MM-dd") : "")' type="text" style="width:100px;height:27px" />


                        </td>

                        <td width="250" nowrap="nowrap">
                            @Html.RadioButton("cxlx", 1, (ViewData["selcxlx"].ToString()=="1"))<label>
                                分户统计
                            </label>
                            @Html.RadioButton("cxlx", 2, (ViewData["selcxlx"].ToString() == "2"))<label>
                                分月统计
                            </label>
                            @Html.RadioButton("cxlx", 3, (ViewData["selcxlx"].ToString() == "3"))<label>
                                分日统计
                            </label>

                        </td>
                        <td colspan="1" width="170" nowarp="nowrap">
                            <input name="" type="button" class="DocSearchThin" onclick="search()"
       value="查询" style="width: 80px" />
                            <input name="" type="button" class="DocSearchThin" onclick="formreset()"
                                           value="重置" style="width: 80px" />
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <br />
        <div style="width:100%;overflow-x:auto">
            <table class="DocTableThin" style="color: Black; font-family: Verdana, 微软雅黑,黑体; width: 1580px;
            margin-left: auto; margin-right: auto;" border="0" id="Investortb" name="Investortb">
                <thead>
                    <tr>
                        <th rowspan="2">项目</th>
                        <th colspan="2">合计</th>
                        <th colspan="2">未结报</th>
                        <th colspan="2">已结报</th>
                        <th colspan="2">已支付</th>
                        <th colspan="2">现金</th>
                        <th colspan="2">刷卡</th>
                        <th colspan="2">支票</th>
                    </tr>
                    <tr>
                        <th>笔数</th>
                        <th>金额</th>
                        <th>笔数</th>
                        <th>金额</th>
                        <th>笔数</th>
                        <th>金额</th>

                        <th>笔数</th>
                        <th>金额</th>
                        <th>笔数</th>
                        <th>金额</th>

                        <th>笔数</th>
                        <th>金额</th>
                        <th>笔数</th>
                        <th>金额</th>
                    </tr>

                </thead>
                <tbody>
                    @if (Model.Rows.Count > 0)
                    {
                        foreach (System.Data.DataRow r in Model.Rows)
                        {
                            <tr>
                                <td>@r["Xm"]</td>
                                <td>@r["BS"]</td>
                                <td>@r["je"]</td>
                                <td>@r["BS_WJB"]</td>
                                <td>@r["je_WJB"]</td>
                                <td>@r["BS_YJB"]</td>
                                <td>@r["je_WJB"]</td>
                                <td>@r["BS_YZF"]</td>
                                <td>@r["je_YZF"]</td>
                                <td>@r["BS_XJ"]</td>
                                <td>@r["JE_XJ"]</td>
                                <td>@r["BS_SK"]</td>
                                <td>@r["Je_SK"]</td>
                                <td>@r["BS_ZP"]</td>
                                <td>@r["JE_ZP"]</td>

                            </tr>
                        }
                    }
                    @if (ViewData["dtHJ"] != null)
                    {
                        System.Data.DataRow r = (ViewData["dtHJ"] as System.Data.DataTable).Rows[0];

                        <tr>
                            <td>合计</td>
                            <td>@r["BS"]</td>
                            <td>@r["je"]</td>
                            <td>@r["BS_WJB"]</td>
                            <td>@r["je_WJB"]</td>
                            <td>@r["BS_YJB"]</td>
                            <td>@r["je_WJB"]</td>
                            <td>@r["BS_YZF"]</td>
                            <td>@r["je_YZF"]</td>
                            <td>@r["BS_XJ"]</td>
                            <td>@r["JE_XJ"]</td>
                            <td>@r["BS_SK"]</td>
                            <td>@r["Je_SK"]</td>
                            <td>@r["BS_ZP"]</td>
                            <td>@r["JE_ZP"]</td>

                        </tr>
                    }
                </tbody>
            </table>
        </div>

        @if (Model != null)
        {
            @GerneratePager(ViewData["page"].ToString(), ViewData["allpage"].ToString(), "javascript:navPage(", ")")
        }
        <br />
    </div>

    @Html.Hidden("id", "1")
    }
</body>
</html>
